<template>
	<router-view  v-slot="{Component}">
		<transition :name="$route.meta.transformName">
			<keep-alive :include="cachedViews">
				<component :is="Component"  :key="routeKey"/>
			</keep-alive>
		</transition>
	</router-view>
	<app-tabbar :modelValue="currentRoute.path" :name="currentRoute.name as string"/>
</template>
<script lang="ts" setup>
const {storeCacheView} = useStore()
const {cachedViews} = storeToRefs(storeCacheView)
const currentRoute=useRoute()
// const activeTab=ref('');
// watch(
// 	() => currentRoute.path,
// 	(newVal,oldVal) => {
// 		if(newVal!==oldVal){
// 			activeTab.value = newVal
// 			console.log('activeTab.value= '+activeTab.value)
// 		}
// 	},{immediate:true}
// );
const routeKey =computed(()=>{
	return currentRoute.meta.routerViewKey || currentRoute.path  // 优先赋值为 routerViewKey
})
</script>
<style lang="scss">

</style>
